package us.pigsoft.client;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Point;
import java.awt.Polygon;

public class Enemy extends Mob {
	
	AttackTypes aType;

	public Enemy(GuiGame game, Dimension bounds, AttackTypes attackType) {
		super(game, bounds);
		
		// Create another sexy triangle 
		Polygon innerSight = new Polygon();
		innerSight.addPoint((int)x+7, (int)y+32);
		innerSight.addPoint((int)x+(size.width/2), (int)y-10);
		innerSight.addPoint((int)(x + size.width - 7), (int)(y+32));
		innerSight.addPoint((int)(x + size.width/2), (int)(y+25));
		shapes.add(innerSight);
		shapeColors.add(Color.BLUE);
		
		x = game.size.getWidth()/2;
		y = game.size.getHeight()/2;
		
		// Choose attack type
		aType = attackType;
	}

	@Override
	public void update() {
		// This will handle most the AI stuff
		// Switch between attack types
		if(aType == AttackTypes.HOMING)
		{
			// Change angle to face the player and go!
			facePlayer(new Point((int)game.player.x, (int)game.player.y));
			
		} else if(aType == AttackTypes.ERRATIC)
		{
			// Pretty much move in random directions while vaguely going
			// towards the player
			
		} else if(aType == AttackTypes.ORBITAL)
		{
			// Orbit around the player on a randomly generated radius
			// within a given range
			
		} else if(aType == AttackTypes.ZIGZAG)
		{
			// Same as homing, but faster.  Can only travel in straight lines,
			// if misses then slow down and redirect towards player's new location
			
		}
	}

	@Override
	public void onDeath() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void attack() {
		// TODO Auto-generated method stub
		
	}

}
